package com.xflib.tool.builder;

public class BuilderArgs {

    public static final String GROUP="group";
    public static final String PROJECT="project";
    public static final String STAGE_CLONE="clone";
    public static final String STAGE_PULL="pull";
    public static final String STAGE_BUILD = "build";
    public static final String STAGE_BRANCH_SWITCH = "switchBranch";
    public static final String STAGE_BRANCH_TAG ="tag";
    public static final String STAGE_BRANCH_NEW ="createBranch";
    public static final String STAGE_BRANCH_DELETE_MERGED ="deleteMergedBranch";

    /**
     *  see {@link BuilderArgs#GROUP} {@link BuilderArgs#PROJECT}
     */
    private String type;

    /**
     *  see {@link BuilderArgs#STAGE_CLONE} {@link BuilderArgs#STAGE_PULL}
     */
    private String stage=STAGE_BUILD;

    /**
     * 数据
     */
    private Object data;

    /**
     * 附加数据
     */
    private String attachData="";

    public String getType() {
        return type;
    }

    public BuilderArgs setType(String type) {
        this.type = type;
        return this;
    }

    public Object getData() {
        return data;
    }

    public BuilderArgs setData(Object data) {
        this.data = data;
        return this;
    }

    public String getStage() {
        return stage;
    }

    public BuilderArgs setStage(String stage) {
        this.stage = stage;
        return this;
    }

    public BuilderArgs cloneWithNoData(){
        return new BuilderArgs()
                .setStage(this.stage)
                //.setData(this.data)
                .setType(this.type)
                .setAttachData(this.attachData);
    }

    public String getAttachData() {
        return attachData;
    }

    public BuilderArgs setAttachData(String attachData) {
        this.attachData = attachData;
        return this;
    }
}
